home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / ae / code / ax3.00 / check_online_status.c < prev    next >
Encoding:
C/C++ Source or Header  |  1980-01-03  |  777 b   |  39 lines

  1. #include "bbs.h"
  2.  
  3. extern int ChatFlag;
  4.  
  5. int Check_Online_Status(void)
  6. {
  7.  int stat;
  8.  
  9.  if(Whence_The_Logon==AWAIT_LOGON)  return(SUCCESS);
  10.  if(Whence_The_Logon==GOODBYE_LOGON)  return(NO_CARRIER);
  11.  if(Whence_The_Logon==REMOTE_LOGON) {
  12.      stat=CheckCarrier();
  13.         if(stat==FALSE)     return(NO_CARRIER);
  14.     }
  15.  
  16.  Time_system=time(NULL);
  17.  
  18.  if(Time_holder==0L)
  19.      Time_holder=Time_system;
  20.  
  21.  if(ChatFlag!=1) {
  22.      User.Time_Used += Time_system-Time_holder;
  23.          Time_limit -= Time_system-Time_holder;
  24.     }
  25.  
  26.  Time_holder=Time_system;
  27.  
  28.  if((Time_limit<=0L)&&(ChatFlag!=1))    {
  29.      AEPutStr("\r\nYou have exceeded your time limit\r\n");
  30.         AEPutStr("Goodbye\r\n\r\n");
  31.      AEPutStr("Disconnecting..");
  32.         Whence_The_Logon=GOODBYE_LOGON;
  33.      DropDTR();
  34.         return(NO_CARRIER);
  35.     }
  36.  
  37.  return(SUCCESS);
  38. }
  39.